package com.qianyu.project.core.mapper;

import com.qianyu.project.core.bean.FormAudit;
import com.qianyu.project.core.mapper.provider.FormAuditProvider;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author gs
 * @date create in 2020/12/11 16:27
 */
@Repository
public interface FormAuditMapper {

    /**
     * description: 保存审批详情 <br/>
     * author: gs   <br/>
     * date: 2020/12/12 <br/>
     * params: [formAudit] <br/>
     * return: java.lang.Integer
     */
    @InsertProvider(type = FormAuditProvider.class,method = "save")
    Integer save(FormAudit formAudit);

    /**
     * description: 根据审批单查询审批详情 <br/>
     * author: gs   <br/>
     * date: 2020/12/12 <br/>
     * params: [fid] <br/>
     * return: java.util.List<com.qianyu.flow.core.pojo.FormAudit>
     */
    @Select("select fa.*,su.user_realname from form_audit fa,form f,system_user su where fa.eid=su.id and  f.fid=fa.fid" +
            " and f.fid=#{value} and fa.isvalid=1")
    List<FormAudit> selectByForm(Integer fid);
    
    

}
